//
//  UIViewController+Util.m
//  SWIOSLibary
//
//  Created by shaowei on 13-7-17.
//  Copyright (c) 2013年 LianZhan. All rights reserved.
//

#import "UIViewController+Util.h"

@implementation UIViewController (Util)

- (BOOL)hiddenKeyboard{
    return [self hiddenKeyboardInView:self.view];
    
}

#pragma mark Function - Private

- (BOOL)hiddenKeyboardInView:(UIView *)showView{
    NSArray *subViews = showView.subviews;
    BOOL result = NO;
    for (UIView *subView in subViews) {
        if ([subView isFirstResponder]) {
            [subView resignFirstResponder];
            result = YES;
            break;
        }else{
            BOOL subResult = [self hiddenKeyboardInView:subView];
            if (subResult) {
                result = YES;
                break;
            }
        }
    }
    
    return result;
}


@end
